fix(vmi): dynamic vci index + group-periodic share (raw vci) - #1112
fix(vmi): dynamic vci index + group-periodic share (raw vci)#1112peanutchan wants to merge 9 commits into
Conversation
|
当前 例如
请明确并统一接口约束:
另外,grouped deinterleaved layout 也需要纳入约束或测试;当前 |
|
已按方案 1 补齐,并统一了 PTODSL / ODS verify / VMIToVPTO 的约束(最新 commit
请再看一眼 PR description 与上述 lit。 |
|
E2E verification update:
The launch probes are now committed on this PR branch in |
|
复检 1. [P1] deinterleaved 修复在真实编译流程中可能不会触发PR 的处理思路是:当 grouped 问题是该 rewrite 与 layout assignment 的执行顺序相反: 对应 pipeline 在 正常 PTODSL/PTO surface IR 在这个阶段还没有 layout。因此真实流程可能是: 这里不是假设 layout assignment 会自动保护 iota: 新增测试 这等于提前向 rewrite 提供了 production pipeline 在该阶段尚不知道的信息,所以测试能通过,不能证明从无 layout 的 surface IR 出发也能通过。 建议考虑定义一条独立的内部 legacy op,例如 这里不需要增加新的 PTODSL 用户 API;对外仍是 这样当 widening/elementwise consumer 请求 独立 op 也可以把 group 整除约束、full-VL/sub-VL materialization 和 grouped lowering 从普通 iota 的 verifier/lowering 中隔离出来,避免继续在多个阶段用 同时请增加一个从无 layout 的 2. [P2]
|
|
Addressed the two correctness blockers in
Verified:
|
|
E2E follow-up for
Remaining environment/coverage limitations:
So grouped share/sub-VL/tail lowering is native/camodel e2e validated; deinterleaved assignment is not yet runtime-covered. |
|
Rebased onto latest Conflict resolved in
Force-pushed |
c38c487 to
dc4132d
Compare
|
Post-rebase regression at Local results:
Every native case produced ARM Tracked working tree is clean. GitHub CI is still pending after the rebase. |
Dynamic loop IVs (TileLang T.serial / scf.for) arrive as MLIR index. VCI ODS/verify require an integer/float sreg element type; default index→i32 so dynamic bases lower to VCI Vd, Sn like Ascend S.vci. Co-authored-by: Cursor <cursoragent@cursor.com>
Dynamic group=2 (VL128) failed on camodel when contiguous iota used
raw VCI with a register Sn base. Restore {group} on vci/iota, keep
group-periodic lane offsets, and materialize contiguous chunks as
vci(0)+vadds like deinterleaved/ASC so dynamic bases rematerialize.
Co-authored-by: Cursor <cursoragent@cursor.com>
group=2 is group-periodic [base..base+S | …], not a continuous 0..L-1 ramp. Physical parts with the same laneOffset reuse one iota chunk so VL128 group=2 does not re-emit duplicate vci/vadds. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the vci(0)+vadds contiguous materialize path; contiguous iota is pto.vci(chunkBase) again, with group=2 reusing one SSA. Replace the topk-heavy share proof with lit expectations plus a simple vci(0)+vadds(1000)+vsts camodel example. Co-authored-by: Cursor <cursoragent@cursor.com>
Support group-periodic vci/iota when S < physVL (mask+vsel), and rewrite non-contiguous grouped results to contiguous iota + ensure_layout so layout infer handles interleave/deinterleave without a dedicated path. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace unpack-only checks with real consumers: shared group2 + vadds/vsts, more sub-VL group sizes (i32 g2/g4/g8, i16 g2/g4), and deint + sitofp vcvt. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid mixing top-level mlir.ir bindings with ptoas MLIR types in the untileable group reject check. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise full-VL sharing and sub-VL group restart semantics through vadds, vsts, and GM output so native regressions catch lowering gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
Lower grouped VCI through a contiguous-only internal producer so layout assignment materializes deinterleaved consumers, while normalizing group=1 to ordinary tail-capable iota. Co-authored-by: Cursor <cursoragent@cursor.com>
dc4132d to
dc668b9
Compare
|
Rebased again onto latest Conflict resolved in
Force-pushed |
|
复检最新 1. [P1] group>1 的逻辑 tail 会通过 API/verifier,但在 VMIToVPTO 必然 legalization 失败以
建议把契约统一为支持 grouped logical tail:去掉“物理容量必须恰好等于逻辑长度”的限制,让最后一个物理 chunk 的超出 lane 沿用普通 tail 的 inactive/padding 处理; 2. [P2]
|
Summary
TileLang T.serial/scf.for) arrive as MLIRindex; coerce to signless i32 in PTODSL sopto.vmi.vciODS/verify accept the base.{group}onvci/iota(ODS + PTODSLgroup=), preserve through unified→legacy and rematerialize.{group}→ continuous rampbase..base+L-1(VL128:0..63then64..127). With{group=C}→ group-periodic restart per group of sizeS = L/C.pto.vci(%chunkBase). Identical group runs share one physical index VL (return %idx, %idxfor VL128/g=2).S < physVLandphysVL % S == 0, e.g. i3264/g=2, i16128/g=2):vci(base)then per-group∓ g·S+ lane-rangevsel. Early reject whenSneither divides nor is a multiple of phys VL (ODS verify + PTODSL).vci/iotato contiguous iota +ensure_layoutso layout infer / rematerialize can producevdintlvetc.Test plan
vmi_to_vpto_iota_group2.pto→ shared%idx = pto.vci %basevmi_to_vpto_iota_group_subvl.pto→ i32 64/g2, i16 128/g2, i32 128/g4 sharevmi_to_vpto_iota_group_deint.pto→ shared contiguousvcithenvdintlvpython3 ptodsl/tests/test_vmi_vci_dynamic_index.py(const / dynamic / group=2 / sub-VL / untileable reject)scripts/sim_dsl.sh --output /tmp/vci_vadds_g2_out ptodsl/examples/vci_vadds_share_launch.py -- --groups 2→
vci(0)+vadds(1000)+vstsexpects1000..1063|1000..1063(g=1:1000..1063)After rebuild:
ninja ptoas_runtime_staging(ptoasloadsruntime-staging/lib/ptoas.so).